4-5/5/2021
Research Workflows
Pipeline
Workflow
R and RStudioR)tidyverseggplot2RMarkdownR?R is:
R languageWhy use R?
RStudio?Please start RStudio
RStudio is an integrated development environment (IDE)R (console/‘scratchpad’); Graphics/visualisation/HelpExcel?”Excel is good for some thingsR is excellent for analysis and reproducibility…R can be run on supercomputers, with extremely large datasets…RStudio overview - INTERACTIVE DEMOVariables are like named boxes
Name)x <- 1 / 40 x
## [1] 0.025
x ^ 2
## [1] 0.000625
log(x)
## [1] -3.688879
name <- "Samia" name
## [1] "Samia"
Variable names are documentation
current_temperature = 28.6 subjectID = "GCF_00001236452.1" GPS_Location = "54N, 36E"
[a-zA-z0-9_.])x2 is allowed, 2x is not)Weight is not the same as weight)lower_snake, UPPER_SNAKE, lowerCamelCase, UpperCamelCaseFunctions (log(), sin() etc.) ≈ “canned script”
sqrt(), lm(), plot())RINTERACTIVE DEMO
args(fname) # arguments for fname
?fname # help page for fname
help(fname) # help page for fname
??fname # any mention of fname
help.search("text") # any mention of "text"
vignette(fname) # worked examples for fname
vignette() # show all available vignettes
What will be the value of each variable after each statement in the following program?
mass <- 47.5 age <- 122 mass <- mass * 2.3 age <- age - 20
mass = 47.5, age = 102mass = 109.25, age = 102mass = 47.5, age = 122mass = 109.25, age = 122USE CHALLENGE LINK ON ETHERPAD
RTHERE IS NO ONE TRUE WAY (only principles)
data?)clean_data?)